<?php use_javascript('toggle.js') ?>
<?php if ($milestones->count()==0){
  ?><p class="error_list"><small><?php echo "There are no Milestones/Tasks against this projects" ?></small></p><?php
}
else {
?>
<div id="tasks">
  
  <?php foreach ($milestones as $milestone): ?>        
    <div class="milestone">
      <div>
      <h4 style="background-color:#FFCC66" ><a href='#' id='toggleLink'></a>Milestone [<a style="text-decoration:underline" href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid())?>"><?php echo $milestone ?></a>]</h4></div>
      <div id="toggle">
      <?php include_partial('task/list', array('tasks' => $milestone->getTasks(sfConfig::get('app_max_tasks_to_show')))) ?> 
      <?php if (($count = $milestone->countTasks() - sfConfig::get('app_max_tasks_to_show')) > 0): ?>
        <div class="more_tasks">
          and <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid())?>"><?php echo $count ?></a>
          more...
        </div>
      <?php endif; ?>
      <hr/>
      </div>    
    </div>
  <?php endforeach; ?>
</div>
<!--<a href="<?php echo url_for('task/new') ?>">New</a>-->

<?php }?>